package com.swanclouds.redfish.common.redfish;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.swanclouds.model.ModelEntity;

/**
 *  * Description:
 *  * Author:      zhangliqiang@asiacom.net.cn
 *  * Date:        2022-07-16 11:06.
 *  
 */
@JsonRootName("ProcessorSummary")
public class ProcessorSummary implements ModelEntity {
    @JsonProperty("Count")
    private Integer count;

    @JsonProperty("Model")
    private String model;

    @JsonProperty("Status")
    private Status status;

    @JsonRootName("Status")
    public static class Status {

        @JsonProperty("HealthRollup")
        private String healthRollup;

        public String getHealthRollup() {
            return healthRollup;
        }

        public void setHealthRollup(String healthRollup) {
            this.healthRollup = healthRollup;
        }

        @Override
        public String toString() {
            ObjectMapper objectMapper = new ObjectMapper();
            try {
                objectMapper.writeValueAsString(this);
            } catch (JsonProcessingException e) {
            }
            return "Status {" +
                    "healthRollup='" + healthRollup + '\'' +
                    '}';
        }
    }

    @Override
    public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
        }
        return "ProcessorSummary{" +
                "count=" + count +
                ", model='" + model + '\'' +
                ", status=" + status +
                '}';
    }

}
